/**
 * 
 */

/**
 * @author Fawkes
 *
 */
public class Formations {
	//Numeros para 442, hay que hacer un XML y un metodo que lo lea.
//	private double defPosX[]={-52.5,-20,-20,-20,-20,-5,-10,-5,0,-0.204,0};
//	private double defPosY[]={0,-25,-5,5,25,-10,0,10,-18,-0.3265,18};
	
	private double defPosX[]={-52.5,-39.0,-39.0,-39.0,-39.0,-13.13,-13.13,-13.13,-13.13,-0.204,0};
	private double defPosY[]={0, -25.5,-8,8.5,25,-25.5,-8,8,25.5,-0.3265,18};
	
	
	
	
	
	public void getFormation(int playerNum,Player p){ //determina la posicion y deberia poder ser manipulado por el coach
		int number=p.getNumber();
		String side = p.getSide();
		//double position[]=new double[2];
		boolean goalie = p.isGoalie();
		if (goalie){
			if(side.equals("left")){
				p.move(defPosX[0],defPosY[0]);
				
			}
			if(side.equals("right")){
				p.move(defPosX[0]*-1,defPosY[0]);
			}
		}
		switch (number){
		 case 2:
			 if (side.equals("left")){
				 p.move(defPosX[1], defPosY[1]);
			 }else{
				 p.move(defPosX[1]*-1, defPosY[1]);
			 }
		 break;
		
		 case 3:
			 if (side.equals("left")){
				 p.move(defPosX[2], defPosY[2]);
			 }else{
				 p.move(defPosX[2]*-1, defPosY[2]);
			 }
		 break;
		 
		 case 4:
			 if (side.equals("left")){
				 p.move(defPosX[3], defPosY[3]);
			 }else{
				 p.move(defPosX[3]*-1, defPosY[3]);
			 }
		break;
		
		 case 5:
			 if (side.equals("left")){
				 p.move(defPosX[4], defPosY[4]);
			 }else{
				 p.move(defPosX[4]*-1, defPosY[4]);
			 }
		 break;
		 
		 case 6:
			 if (side.equals("left")){
				 p.move(defPosX[5], defPosY[5]);
			 }else{
				 p.move(defPosX[5]*-1, defPosY[5]);
			 }
		 break;
		 
		 case 7:
			 if (side.equals("left")){
				 p.move(defPosX[6], defPosY[6]);
			 }else{
				 p.move(defPosX[6]*-1, defPosY[6]);
			 }
		 break;
		 
		 case 8:
			 if (side.equals("left")){
				 p.move(defPosX[7], defPosY[7]);
			 }else{
				 p.move(defPosX[7]*-1, defPosY[7]);
			 }
		 break;
		 
		 case 9:
			 if (side.equals("left")){
				 p.move(defPosX[8], defPosY[8]);
			 }else{
				 p.move(defPosX[8]*-1, defPosY[8]);
			 }
		 break;
		 
		 case 10:
			 if (side.equals("left")){
				 p.move(defPosX[9], defPosY[9]);
			 }else{
				 p.move(defPosX[9]*-1, defPosY[9]);
			 }
		 break;
		 
		 case 11:
			 if (side.equals("left")){
				 p.move(defPosX[10], defPosY[10]);
			 }else{
				 p.move(defPosX[10]*-1, defPosY[10]);
			 }
		 break;
		 
		 default:
			break;
		 
		}
			
	}
	

}
